/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tmp.ac.ui.setting;

import tmp.ac.lib.tools.DBClass;
import tmp.ac.lib.tools.files;
import ac.uitls.propertiesOperation;
import tmp.ac.lib.tools.uiUtil;
import tmp.ac.options.DataFrame;
import tmp.ac.options.DataModel;
import tmp.ac.options.urls;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.sql.ResultSet;
import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

/**
 *
 * @author amrmo_sho
 */
public class menuSetting extends javax.swing.JPanel {

    /**
     * Creates new form menuSetting
     */
    propertiesOperation po = new propertiesOperation();
    uiUtil u = new uiUtil();
    DBClass db = new DBClass();
    tmp.ac.options.shortcuts ch = new tmp.ac.options.shortcuts();
    tmp.ac.engin.setting.menuSetting gs;
    tmp.ac.engin.setting.menuItemsSetting gis;

    public menuSetting() {
        gs = new tmp.ac.engin.setting.menuSetting();
        gis = new tmp.ac.engin.setting.menuItemsSetting();
        initComponents();
        genUpdate();
        u.updatepanelWords(jTabbedPane1.getParent().getComponents());
        categoriesUpdate();
        itemsUpdate();

    }

    private void genUpdate() {

        jTabbedPane1.setTitleAt(1, "menuCategories_tab");
        jTabbedPane1.setTitleAt(0, "menuItems_tab");

    }
    // <editor-fold defaultstate="collapsed" desc="ItemCode">
    int itemsSaveStatus = 0;
    int itemsUpdatStatus = 0;
    int itemsexID = 0;
    int itemsUpdateID = 0;
    String imageUrl = "";
    String chFileName = "";
    String chDirName = "";

    private void getImage() {
        JFileChooser chooser = new JFileChooser(".");
        int a = chooser.showOpenDialog(this);
        if (a == JFileChooser.APPROVE_OPTION) {
            try {


                updateImage(chooser.getSelectedFile().toURL());
                chFileName = chooser.getSelectedFile().getName();
                chDirName = "" + chooser.getCurrentDirectory();
            } catch (Exception ex) {
                uiUtil.sendAlert(this, "error", ex.getMessage());
            }

        }

    }

    private void compoboxupdate() {
        DataFrame df = new DataFrame();
        uiu.fillCombox(link_cb, df.itemsFrames);
        String[] metest = {"mid", "otherWindows"};
        String[] mevalue = {"0", "1"};
        uiu.fillCombox(type_cb, mevalue, metest);
        uiu.fillCombox(menucat_cb, DataModel.MENU_CATEGORIES, "id", "title");

    }

    private void itemsUpdate() {
        compoboxupdate();
        u.clearPanel(itemsPanel.getComponents(), false);
        this.itemsTabelUpdat("", "");
        tabelItem.getSelectionModel().setSelectionInterval(0, 0);
        tabelItem.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        uiu.fahres(tabelItem, tableLabelData1, first_bt1, perv_bt1, next_bt1, last_bt1);
        
        
        tabelItem.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {

                int sel = tabelItem.getSelectedRow();
                if (sel != -1) {

                    String domain = tabelItem.getValueAt(sel, 0).toString();
                    itemsexID = Integer.parseInt(domain);

                    updateitemsItems(domain);
                }
            }
        });



    }

    private void updateImage(URL utl) {

        ImageIcon imageIcon = new ImageIcon(utl);
        ImageIcon thumbnailIcon = new ImageIcon(new files().getScaledImage(imageIcon.getImage(), 225, 180));
        jlabelImage.setIcon(thumbnailIcon);
    }

    private void updateitemsItems(String id) {


        try {

            String[] categoreyData = gis.getRow("id", id);
            itemsTitle_txt.setText(categoreyData[2]);
            uiUtil.setComBoxSelectonByValue(menucat_cb, categoreyData[1]);
            updateImage(this.getClass().getResource(urls.Image_URL + "" + categoreyData[3]).toURI().toURL());
            uiUtil.setComBoxSelectonByValue(link_cb, categoreyData[4]);
            itemsDec_ta.setText(categoreyData[5]);
            //     uiu.sendMessage(this, id, Arrays.deepToString(categoreyData));
            itemsWidth_txt.setText(categoreyData[7]);
            uiUtil.setComBoxSelectonByValue(type_cb, categoreyData[6]);
            itemsHeight_txt.setText(categoreyData[8]);

        } catch (Exception ex) {
            uiu.sendMessage(this, id, ex.getMessage());
        }

    }

    private void itemsTabelUpdat(String wherefiled, String whereValue) {
        ResultSet rs = gis.getAll(wherefiled, whereValue);
        uiu.TabelUpdat(
                tabelItem,
                rs,
                new String[]{"id", po.getWord("title")},
                new String[]{"id", "title"},
                new int[]{0});

        db.setCloseCon();
        tabelItem.getSelectionModel().setSelectionInterval(0, 0);
    }
    //"catid", "title", "image", "link", "des", "status", "width", "height"

    private void itemsSave() {
        
        if (itemsSaveStatus == 0) {
            u.clearPanel(itemsPanel.getComponents(), true);
            itemsadd_bt.setText(po.getWord("label.save"));
            itemsSaveStatus = 1;
        } else {

            jProgressBar1.setValue(0);
            jProgressBar1.setStringPainted(true);


            gis.Data = new String[8];
            uiu.saveImage(chDirName, chFileName);
            gis.Data[0] = uiUtil.getComBoxValue(menucat_cb);
            gis.Data[1] = itemsTitle_txt.getText();
            gis.Data[2] = chFileName;
            gis.Data[3] = uiUtil.getComBoxValue(link_cb);
            gis.Data[4] = itemsDec_ta.getText();
            gis.Data[5] = uiUtil.getComBoxValue(type_cb);
            gis.Data[6] = itemsWidth_txt.getText();
            gis.Data[7] = itemsHeight_txt.getText();

            u.sendMessage(this, po.getWord("label.save"), gis.addNew());
            itemsSaveStatus = 0;
            itemsadd_bt.setText(po.getWord("label.add"));
            this.itemsTabelUpdat("", "");

        }


    }

    private void itemsSetUpdate() {


        if (itemsUpdatStatus == 0) {
            // u.EnablePanel(itemsPanel.getComponents(), true);
            itemsupdate_bt.setText(po.getWord("label.saveUpdate"));
            itemsUpdateID = itemsexID;
            itemsUpdatStatus = 1;

        } else {

            gis.Data = new String[8];
            uiu.saveImage(chDirName, chFileName);
            gis.Data[0] = uiUtil.getComBoxValue(menucat_cb);
            gis.Data[1] = itemsTitle_txt.getText();
            gis.Data[2] = chFileName;
            gis.Data[3] = uiUtil.getComBoxValue(link_cb);
            gis.Data[4] = itemsDec_ta.getText();
            gis.Data[5] = uiUtil.getComBoxValue(type_cb);
            gis.Data[6] = itemsWidth_txt.getText();
            gis.Data[7] = itemsHeight_txt.getText();
            u.sendMessage(this, po.getWord("label.saveUpdate"), gis.UpdateNew(itemsUpdateID));

            itemsupdate_bt.setText(po.getWord("label.update"));
            itemsUpdatStatus = 0;
            //  u.EnablePanel(itemsPanel.getComponents(), false);
            this.itemsTabelUpdat("", "");

        }
    }

    private void itemsCancel() {
        itemsadd_bt.setText(po.getWord("label.add"));
        itemsupdate_bt.setText(po.getWord("label.update"));
        itemsSaveStatus = 0;
        itemsUpdatStatus = 0;
        this.itemsTabelUpdat("", "");
        //   u.EnablePanel(itemsPanel.getComponents(), false);
    }

    private void itemsDelete() {
        int re = uiUtil.sendAlert(this, po.getWord("title.delete"), po.getWord("message.delete"));


        if (re == 0) {

            String data = gis.deleteCategory(itemsexID);

            if (!data.equals("")) {

                uiUtil.sendMessage(this, po.getWord("title.delete"), "" + data);
                this.itemsTabelUpdat("", "");

            }



        }





    }

    private void chortCuts(java.awt.event.KeyEvent evt) {

        if (evt.getKeyCode() == ch.getchortCut("save")) {
            catSave();
        } else if (evt.getKeyCode() == ch.getchortCut("cancel")) {
            catCancel();
        } else if (evt.getKeyCode() == ch.getchortCut("delete")) {
            catDelete();
        } else if (evt.getKeyCode() == ch.getchortCut("update")) {
            catUpdate();
        }
    }
// </editor-fold>
    
    // <editor-fold defaultstate="collapsed" desc="catCode">
    int SaveStatus = 0;
    int UpdatStatus = 0;
    int exID = 0;
    int UpdateID = 0;

    private void categoriesUpdate() {
        u.clearPanel(jPanel1.getComponents(), false);
        this.categoriesTabelUpdat("", "");
        jTable1.getSelectionModel().setSelectionInterval(0, 0);
        jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        uiu.fahres(jTable1, tableLabelData, first_bt, perv_bt, next_bt, last_bt);
        jTable1.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {

                int sel = jTable1.getSelectedRow();
                if (sel != -1) {


                    String domain = jTable1.getValueAt(sel, 0).toString();
                    exID = Integer.parseInt(domain);
                    updateCatItems(domain);
                }
            }
        });
    }

    private void updateCatItems(String id) {

        String[] categoreyData = gs.getRow("id", id);
        title_txt.setText(categoreyData[1]);
        order_txt.setText(categoreyData[3]);
        des_txt.setText(categoreyData[2]);
        color_txt.setText(categoreyData[4]);
        Color bColor = Color.decode("#" + categoreyData[4]);
        color_txt.setBackground(bColor);
    }

    private void categoriesTabelUpdat(String wherefiled, String whereValue) {
        ResultSet rs = gs.getAll(wherefiled, whereValue);
        uiu.TabelUpdat(
                jTable1,
                rs,
                new String[]{"id", po.getWord("title")},
                new String[]{"id", "title"},
                new int[]{0});

        db.setCloseCon();
        jTable1.getSelectionModel().setSelectionInterval(0, 0);
    }

    private void catSave() {
        if (SaveStatus == 0) {
            jPanel1.setEnabled(true);
            u.clearPanel(jPanel1.getComponents(), true);
            add_bt.setText(po.getWord("label.save"));
            order_txt.setText(gs.getMax("order") + 1);
            SaveStatus = 1;
        } else {

            gs.Data = new String[4];
            gs.Data[0] = title_txt.getText();
            gs.Data[2] = order_txt.getText();
            gs.Data[3] = color_txt.getText();
            gs.Data[1] = des_txt.getText();
            u.sendMessage(this, po.getWord("label.save"), gs.addNew());
            SaveStatus = 0;
            add_bt.setText(po.getWord("label.add"));
            //  u.EnablePanel(jPanel1.getComponents(), false);
            this.categoriesTabelUpdat("", "");

        }


    }

    private void catUpdate() {


        if (UpdatStatus == 0) {
            // u.EnablePanel(jPanel1.getComponents(), true);
            update_bt.setText(po.getWord("label.saveUpdate"));
            UpdateID = exID;
            UpdatStatus = 1;

        } else {

            gs.Data = new String[4];
            gs.Data[0] = title_txt.getText();
            gs.Data[2] = order_txt.getText();
            gs.Data[3] = color_txt.getText();
            gs.Data[1] = des_txt.getText();
            u.sendMessage(this, po.getWord("label.saveUpdate"), gs.UpdateNew(UpdateID));

            update_bt.setText(po.getWord("label.update"));
            UpdatStatus = 0;
            //  u.EnablePanel(jPanel1.getComponents(), false);
            this.categoriesTabelUpdat("", "");

        }
    }

    private void catCancel() {
        add_bt.setText(po.getWord("label.add"));
        update_bt.setText(po.getWord("label.update"));
        SaveStatus = 0;
        UpdatStatus = 0;
        this.categoriesTabelUpdat("", "");
        //   u.EnablePanel(jPanel1.getComponents(), false);
    }

    private void catDelete() {
        int re = uiUtil.sendAlert(this, po.getWord("title.delete"), po.getWord("message.delete"));


        if (re == 0) {

            String data = gs.deleteCategory(exID);

            if (!data.equals("")) {

                uiUtil.sendMessage(this, po.getWord("title.delete"), "" + data);
                this.categoriesTabelUpdat("", "");

            }



        }





    }

    private void catchortCuts(java.awt.event.KeyEvent evt) {

        if (evt.getKeyCode() == ch.getchortCut("save")) {
            catSave();
        } else if (evt.getKeyCode() == ch.getchortCut("cancel")) {
            catCancel();
        } else if (evt.getKeyCode() == ch.getchortCut("delete")) {
            catDelete();
        } else if (evt.getKeyCode() == ch.getchortCut("update")) {
            catUpdate();
        }
    }

// </editor-fold>
    
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jSplitPane1 = new javax.swing.JSplitPane();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jToolBar1 = new javax.swing.JToolBar();
        first_bt = new javax.swing.JButton();
        perv_bt = new javax.swing.JButton();
        tableLabelData = new javax.swing.JLabel();
        next_bt = new javax.swing.JButton();
        last_bt = new javax.swing.JButton();
        jTextField1 = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        title_txt = new javax.swing.JTextField();
        order_txt = new javax.swing.JTextField();
        des_txt = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        color_txt = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jToolBar3 = new javax.swing.JToolBar();
        jToolBar2 = new javax.swing.JToolBar();
        add_bt = new javax.swing.JButton();
        update_bt = new javax.swing.JButton();
        cancel_bt = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        delete_bt = new javax.swing.JButton();
        jSplitPane2 = new javax.swing.JSplitPane();
        itemsPanel = new javax.swing.JPanel();
        itemsTitle_txt = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jToolBar4 = new javax.swing.JToolBar();
        jToolBar5 = new javax.swing.JToolBar();
        itemsadd_bt = new javax.swing.JButton();
        itemsupdate_bt = new javax.swing.JButton();
        itemscancel_bt = new javax.swing.JButton();
        delete_bt1 = new javax.swing.JButton();
        itemsClose_bt = new javax.swing.JButton();
        menucat_cb = new javax.swing.JComboBox();
        link_cb = new javax.swing.JComboBox();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        jlabelImage = new javax.swing.JLabel();
        type_cb = new javax.swing.JComboBox();
        jLabel13 = new javax.swing.JLabel();
        itemsDec_ta = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        itemsWidth_txt = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        itemsHeight_txt = new javax.swing.JTextField();
        jProgressBar1 = new javax.swing.JProgressBar();
        jPanel6 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tabelItem = new javax.swing.JTable();
        jToolBar6 = new javax.swing.JToolBar();
        first_bt1 = new javax.swing.JButton();
        perv_bt1 = new javax.swing.JButton();
        tableLabelData1 = new javax.swing.JLabel();
        next_bt1 = new javax.swing.JButton();
        last_bt1 = new javax.swing.JButton();
        jTextField2 = new javax.swing.JTextField();

        addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                formKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                formKeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                formKeyTyped(evt);
            }
        });
        setLayout(new java.awt.CardLayout());

        jTabbedPane1.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);
        jTabbedPane1.setTabPlacement(javax.swing.JTabbedPane.BOTTOM);

        jSplitPane1.setDividerLocation(205);
        jSplitPane1.setDividerSize(10);

        jScrollPane1.setPreferredSize(new java.awt.Dimension(452, 100));

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jTable1.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_LAST_COLUMN);
        jTable1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTable1KeyReleased(evt);
            }
        });
        jScrollPane1.setViewportView(jTable1);

        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);

        first_bt.setText("first_bt");
        first_bt.setFocusable(false);
        first_bt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        first_bt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(first_bt);

        perv_bt.setText("perv_bt");
        perv_bt.setFocusable(false);
        perv_bt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        perv_bt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(perv_bt);

        tableLabelData.setText("/");
        jToolBar1.add(tableLabelData);

        next_bt.setText("next_bt");
        next_bt.setFocusable(false);
        next_bt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        next_bt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(next_bt);

        last_bt.setText("last_bt");
        last_bt.setFocusable(false);
        last_bt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        last_bt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(last_bt);

        jTextField1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jTextField1PropertyChange(evt);
            }
        });
        jTextField1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTextField1KeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextField1KeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jTextField1KeyTyped(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
            .addComponent(jToolBar1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 204, Short.MAX_VALUE)
            .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.TRAILING)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 313, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jSplitPane1.setLeftComponent(jPanel2);

        jPanel1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jPanel1KeyPressed(evt);
            }
        });

        title_txt.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                title_txtKeyPressed(evt);
            }
        });

        order_txt.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                order_txtKeyPressed(evt);
            }
        });

        des_txt.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                des_txtKeyPressed(evt);
            }
        });

        jLabel3.setText("des_lb");

        jLabel2.setText("order_lb");

        jLabel1.setText("title_lb");

        color_txt.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                color_txtMouseClicked(evt);
            }
        });
        color_txt.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                color_txtKeyPressed(evt);
            }
        });

        jLabel5.setText("color_lb");

        jLabel7.setText("menuCategories_lb");
        jLabel7.setBorder(javax.swing.BorderFactory.createBevelBorder(0));

        jToolBar3.setFloatable(false);

        jToolBar2.setBorder(null);
        jToolBar2.setRollover(true);

        add_bt.setText("add_bt");
        add_bt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                add_btActionPerformed(evt);
            }
        });
        jToolBar2.add(add_bt);

        update_bt.setText("update_bt");
        update_bt.setFocusable(false);
        update_bt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        update_bt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        update_bt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                update_btActionPerformed(evt);
            }
        });
        jToolBar2.add(update_bt);

        cancel_bt.setText("cancel_bt");
        cancel_bt.setFocusable(false);
        cancel_bt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        cancel_bt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        cancel_bt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancel_btActionPerformed(evt);
            }
        });
        jToolBar2.add(cancel_bt);

        jButton6.setText("close_bt");
        jButton6.setFocusable(false);
        jButton6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton6.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar2.add(jButton6);

        delete_bt.setText("delete_bt");
        delete_bt.setFocusable(false);
        delete_bt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        delete_bt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        delete_bt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                delete_btActionPerformed(evt);
            }
        });
        jToolBar2.add(delete_bt);

        jToolBar3.add(jToolBar2);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(jLabel3)
                            .addComponent(jLabel1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(order_txt, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(41, 41, 41)
                                .addComponent(jLabel5)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(color_txt, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 373, Short.MAX_VALUE))
                            .addComponent(des_txt)
                            .addComponent(title_txt)))
                    .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jToolBar3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(4, 4, 4)
                .addComponent(jToolBar3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(title_txt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(order_txt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2)
                    .addComponent(color_txt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(des_txt, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 120, Short.MAX_VALUE))
        );

        jSplitPane1.setRightComponent(jPanel1);

        jTabbedPane1.addTab("tab3", jSplitPane1);

        jLabel6.setText("title_lb");

        jLabel8.setText("menuItems_lb");
        jLabel8.setBorder(javax.swing.BorderFactory.createBevelBorder(0));

        jToolBar4.setFloatable(false);

        jToolBar5.setBorder(null);
        jToolBar5.setRollover(true);

        itemsadd_bt.setText("add_bt");
        itemsadd_bt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemsadd_btActionPerformed(evt);
            }
        });
        jToolBar5.add(itemsadd_bt);

        itemsupdate_bt.setText("update_bt");
        itemsupdate_bt.setFocusable(false);
        itemsupdate_bt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        itemsupdate_bt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        itemsupdate_bt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemsupdate_btActionPerformed(evt);
            }
        });
        jToolBar5.add(itemsupdate_bt);

        itemscancel_bt.setText("cancel_bt");
        itemscancel_bt.setFocusable(false);
        itemscancel_bt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        itemscancel_bt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        itemscancel_bt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemscancel_btActionPerformed(evt);
            }
        });
        jToolBar5.add(itemscancel_bt);

        delete_bt1.setText("delete_bt");
        delete_bt1.setFocusable(false);
        delete_bt1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        delete_bt1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        delete_bt1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                delete_bt1ActionPerformed(evt);
            }
        });
        jToolBar5.add(delete_bt1);

        itemsClose_bt.setText("close_bt");
        itemsClose_bt.setFocusable(false);
        itemsClose_bt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        itemsClose_bt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        itemsClose_bt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                itemsClose_btActionPerformed(evt);
            }
        });
        jToolBar5.add(itemsClose_bt);

        jToolBar4.add(jToolBar5);

        jLabel9.setText("menuCategories_lb");

        jLabel10.setText("link_lb");

        jLabel16.setText("image_lb");

        jlabelImage.setText("jLabel11");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel16)
                .addGap(27, 27, 27)
                .addComponent(jlabelImage, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jlabelImage, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel16)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );

        jLabel13.setText("type_lb");

        itemsDec_ta.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                itemsDec_taKeyPressed(evt);
            }
        });

        jLabel4.setText("des_lb");

        jLabel14.setText("width_lb");

        jLabel15.setText("height_lb");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel14)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(itemsWidth_txt, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(44, 44, 44)
                .addComponent(jLabel15)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(itemsHeight_txt, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(53, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(itemsWidth_txt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14)
                    .addComponent(itemsHeight_txt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel15))
                .addContainerGap())
        );

        jProgressBar1.setStringPainted(true);

        javax.swing.GroupLayout itemsPanelLayout = new javax.swing.GroupLayout(itemsPanel);
        itemsPanel.setLayout(itemsPanelLayout);
        itemsPanelLayout.setHorizontalGroup(
            itemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jToolBar4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(itemsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(itemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(itemsPanelLayout.createSequentialGroup()
                        .addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(itemsPanelLayout.createSequentialGroup()
                        .addGroup(itemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel6)
                            .addComponent(jLabel9))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(itemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(itemsPanelLayout.createSequentialGroup()
                                .addGroup(itemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(type_cb, javax.swing.GroupLayout.PREFERRED_SIZE, 272, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(itemsDec_ta, javax.swing.GroupLayout.PREFERRED_SIZE, 277, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(35, 35, 35)
                                .addGroup(itemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                            .addComponent(itemsTitle_txt, javax.swing.GroupLayout.PREFERRED_SIZE, 595, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(itemsPanelLayout.createSequentialGroup()
                                .addComponent(menucat_cb, javax.swing.GroupLayout.PREFERRED_SIZE, 272, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(48, 48, 48)
                                .addComponent(jLabel10)
                                .addGap(18, 18, 18)
                                .addComponent(link_cb, javax.swing.GroupLayout.PREFERRED_SIZE, 228, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(itemsPanelLayout.createSequentialGroup()
                        .addGroup(itemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel13)
                            .addComponent(jLabel4))
                        .addGap(0, 0, Short.MAX_VALUE))))
        );
        itemsPanelLayout.setVerticalGroup(
            itemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(itemsPanelLayout.createSequentialGroup()
                .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(2, 2, 2)
                .addComponent(jToolBar4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(itemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(itemsTitle_txt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(itemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(menucat_cb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9)
                    .addComponent(link_cb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(itemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(itemsPanelLayout.createSequentialGroup()
                        .addGroup(itemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(type_cb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel13))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(itemsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(itemsDec_ta, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(itemsPanelLayout.createSequentialGroup()
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 68, Short.MAX_VALUE)
                .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jSplitPane2.setRightComponent(itemsPanel);

        jScrollPane2.setPreferredSize(new java.awt.Dimension(452, 100));

        tabelItem.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        tabelItem.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_LAST_COLUMN);
        tabelItem.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                tabelItemKeyReleased(evt);
            }
        });
        jScrollPane2.setViewportView(tabelItem);

        jToolBar6.setFloatable(false);
        jToolBar6.setRollover(true);

        first_bt1.setText("first_bt");
        first_bt1.setFocusable(false);
        first_bt1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        first_bt1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar6.add(first_bt1);

        perv_bt1.setText("perv_bt");
        perv_bt1.setFocusable(false);
        perv_bt1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        perv_bt1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar6.add(perv_bt1);

        tableLabelData1.setText("/");
        jToolBar6.add(tableLabelData1);

        next_bt1.setText("next_bt");
        next_bt1.setFocusable(false);
        next_bt1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        next_bt1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar6.add(next_bt1);

        last_bt1.setText("last_bt");
        last_bt1.setFocusable(false);
        last_bt1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        last_bt1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar6.add(last_bt1);

        jTextField2.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jTextField2PropertyChange(evt);
            }
        });
        jTextField2.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTextField2KeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextField2KeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jTextField2KeyTyped(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
            .addComponent(jToolBar6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jTextField2, javax.swing.GroupLayout.Alignment.TRAILING)
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 313, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(jToolBar6, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jSplitPane2.setLeftComponent(jPanel6);

        jTabbedPane1.addTab("tab3", jSplitPane2);

        add(jTabbedPane1, "card3");
    }// </editor-fold>//GEN-END:initComponents
    uiUtil uiu = new uiUtil();
    ////////////

    private void formKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_formKeyTyped
        // TODO add your handling code here:  
    }//GEN-LAST:event_formKeyTyped

    private void formKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_formKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_formKeyPressed

    private void formKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_formKeyReleased
        // TODO add your handling code here:
    }//GEN-LAST:event_formKeyReleased

    private void cancel_btActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancel_btActionPerformed
        // TODO add your handling code here:
        catCancel();
    }//GEN-LAST:event_cancel_btActionPerformed

    private void update_btActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_update_btActionPerformed
        // TODO add your handling code here:
        catUpdate();

    }//GEN-LAST:event_update_btActionPerformed

    private void add_btActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_add_btActionPerformed
        // TODO add your handling code here:
        catSave();
    }//GEN-LAST:event_add_btActionPerformed

    private void color_txtKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_color_txtKeyPressed
        // TODO add your handling code here:
        chortCuts(evt);
    }//GEN-LAST:event_color_txtKeyPressed

    private void color_txtMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_color_txtMouseClicked
        // TODO add your handling code here:
        uiu.createColorFiled(color_txt);
    }//GEN-LAST:event_color_txtMouseClicked

    private void des_txtKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_des_txtKeyPressed
        // TODO add your handling code here:
        catchortCuts(evt);
    }//GEN-LAST:event_des_txtKeyPressed

    private void order_txtKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_order_txtKeyPressed
        // TODO add your handling code here:
        catchortCuts(evt);
    }//GEN-LAST:event_order_txtKeyPressed

    private void title_txtKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_title_txtKeyPressed
        // TODO add your handling code here:
        catchortCuts(evt);
    }//GEN-LAST:event_title_txtKeyPressed

    private void jTextField1KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyTyped
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField1KeyTyped

    private void jTextField1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyReleased
        // TODO add your handling code here:

        this.categoriesTabelUpdat("title", jTextField1.getText());
    }//GEN-LAST:event_jTextField1KeyReleased

    private void jTextField1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyPressed
        // TODO add your handling code here:
        catchortCuts(evt);
    }//GEN-LAST:event_jTextField1KeyPressed

    private void jTextField1PropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jTextField1PropertyChange
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField1PropertyChange

    private void jTable1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTable1KeyReleased
        // TODO add your handling code here:
    }//GEN-LAST:event_jTable1KeyReleased

    private void itemscancel_btActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemscancel_btActionPerformed
        // TODO add your handling code here:
        this.itemsCancel();

    }//GEN-LAST:event_itemscancel_btActionPerformed

    private void itemsupdate_btActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemsupdate_btActionPerformed
        // TODO add your handling code here:
        this.itemsSetUpdate();

    }//GEN-LAST:event_itemsupdate_btActionPerformed

    private void itemsadd_btActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemsadd_btActionPerformed
        // TODO add your handling code here:

        this.itemsSave();
    }//GEN-LAST:event_itemsadd_btActionPerformed

    private void jPanel1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jPanel1KeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_jPanel1KeyPressed

    private void delete_btActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_delete_btActionPerformed
        // TODO add your handling code here:


        catDelete();

    }//GEN-LAST:event_delete_btActionPerformed

    private void itemsDec_taKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_itemsDec_taKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_itemsDec_taKeyPressed

    private void tabelItemKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tabelItemKeyReleased
        // TODO add your handling code here:
    }//GEN-LAST:event_tabelItemKeyReleased

    private void jTextField2PropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jTextField2PropertyChange
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField2PropertyChange

    private void jTextField2KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField2KeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField2KeyPressed

    private void jTextField2KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField2KeyReleased
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField2KeyReleased

    private void jTextField2KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField2KeyTyped
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField2KeyTyped

    private void itemsClose_btActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_itemsClose_btActionPerformed
        // TODO add your handling code here:

        getImage();
    }//GEN-LAST:event_itemsClose_btActionPerformed

    private void delete_bt1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_delete_bt1ActionPerformed
        // TODO add your handling code here:

        this.itemsDelete();
    }//GEN-LAST:event_delete_bt1ActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton add_bt;
    private javax.swing.JButton cancel_bt;
    private javax.swing.JTextField color_txt;
    private javax.swing.JButton delete_bt;
    private javax.swing.JButton delete_bt1;
    private javax.swing.JTextField des_txt;
    private javax.swing.JButton first_bt;
    private javax.swing.JButton first_bt1;
    private javax.swing.JButton itemsClose_bt;
    private javax.swing.JTextField itemsDec_ta;
    private javax.swing.JTextField itemsHeight_txt;
    private javax.swing.JPanel itemsPanel;
    private javax.swing.JTextField itemsTitle_txt;
    private javax.swing.JTextField itemsWidth_txt;
    private javax.swing.JButton itemsadd_bt;
    private javax.swing.JButton itemscancel_bt;
    private javax.swing.JButton itemsupdate_bt;
    private javax.swing.JButton jButton6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JSplitPane jSplitPane2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JToolBar jToolBar2;
    private javax.swing.JToolBar jToolBar3;
    private javax.swing.JToolBar jToolBar4;
    private javax.swing.JToolBar jToolBar5;
    private javax.swing.JToolBar jToolBar6;
    private javax.swing.JLabel jlabelImage;
    private javax.swing.JButton last_bt;
    private javax.swing.JButton last_bt1;
    private javax.swing.JComboBox link_cb;
    private javax.swing.JComboBox menucat_cb;
    private javax.swing.JButton next_bt;
    private javax.swing.JButton next_bt1;
    private javax.swing.JTextField order_txt;
    private javax.swing.JButton perv_bt;
    private javax.swing.JButton perv_bt1;
    private javax.swing.JTable tabelItem;
    private javax.swing.JLabel tableLabelData;
    private javax.swing.JLabel tableLabelData1;
    private javax.swing.JTextField title_txt;
    private javax.swing.JComboBox type_cb;
    private javax.swing.JButton update_bt;
    // End of variables declaration//GEN-END:variables
}
